<!doctype html>
<html>
<head>
	<meta charset="UTF-8" />
	<title>js取最大值和最小值</title>
</head>
<body>
	<h2>看控制台</h2>
	<script type="text/javascript">
		    var arr = [500,105,66,325,1,80,10];
            
            var min = arr[0];
            var max = arr[0];
            
            for (var i=1;i<arr.length;i++) {
            	if(arr[i] > max){
            		max = arr[i];
            	}
            	if(arr[i]<min){
            		min = arr[i];
            	}
            }
            console.log(arr);
            console.log("最小值"+min);
            console.log("最大值"+max);
	</script>
</body>
</html>